<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
			var a = window.prompt("请输入一个数");
			for(var b = 1; b <= a; b++) {
				for(var c = (a - b) * 2; c >= 0; c--) {
					document.write(" ");
				}
				for(var d = 1; d <= b * 2 - 1; d++) {
					document.write("*" + " ");
				}
				document.write("<br/>");
			}
		</script>
	</body>

</html>